﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Audio;

using SpectrEngine.Framework;
using SpectrEngine.Framework.Input;

namespace CellWarzGame.Screens
{
    class GameOverScreen
        : GameScreen
    {
        Texture2D backdrop;
        SoundEffect selectionSound;


        public GameOverScreen(Game game)
            : base(game)
        {
            this.State = ScreenState.Active;
            this.transitionMask = game.Content.Load<Texture2D>("Test\\organic_fade");

            game.Services.GetService<ScreenManager>().AddScreen(this, 0);
            backdrop = game.Content.Load<Texture2D>(@"Images\Game_Over");
            selectionSound = game.Content.Load<SoundEffect>("Sounds\\pop");

        }

        public override void Update(GameTime gameTime)
        {
            if (GamePadManager.IsButtonDown(PlayerIndex.One, GamePadButtons.A))
            {
                new MainMenuScreen(Game);
                Game.Services.GetService<ScreenManager>().RemoveScreen(this);
                selectionSound.Play();
            }

        }


        public override void Draw(Microsoft.Xna.Framework.GameTime gameTime)
        {
            Game.GraphicsDevice.Clear(Color.White);

            spriteBatch.Draw(backdrop, Vector2.Zero, Color.White);

            base.Draw(gameTime);
        }


    }
}
